import React from 'react';
import { BrowserRouter as Router,Route,Routes} from 'react-router-dom';
import HomePage from '../container/home-page';
import BookDetailPage from '../container/book-detail-page';
import CategoryPage from '../container/category-page'
import RecommendPage from '../container/recommend-page';
import {createBrowserHistory} from 'history'

export default class LocalRouter extends React.Component {
    render(){
        return(
            <div>
                <Router>
                    <Routes>
                        <Route path="/">
                            <Route index element={<HomePage />} />
                            <Route path="book/:id" element={<BookDetailPage/>}/>
                            <Route path="category/:categoryid" element={<CategoryPage/>}/>
                            <Route path="recommend" element={<RecommendPage/>}/>
                            <Route path="home" element={<HomePage />} />
                        </Route>
                    </Routes>
                </Router>
            </div>
        )
    }
}